package router

import (
	"server/application/constant/apis"
	"server/application/constant/enums"
	"server/application/controller/custctrl"
	"server/application/db/schema/sdto"
	"server/application/dto"
	"server/application/dto/requestdto"
	"server/pkg/ginp"
)

func init() {

	//创建
	AppendRouter(ItemInfo{
		Path:           apis.ApiTripCreate,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripCreate), //对应控制器
		HttpType:       HttpPost,                              //http请求类型
		NeedLogin:      false,                                 //是否需要登录
		NeedPermission: false,                                 //是否需要鉴权
		PermissionName: "Trip.create",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "创建旅行",
			Description: "",
			RequestDto:  sdto.TripCreate{},
		},
	})

	//修改
	AppendRouter(ItemInfo{
		Path:           apis.ApiTripUpdate,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripUpdate), //对应控制器
		HttpType:       HttpPost,                              //http请求类型
		NeedLogin:      true,                                  //是否需要登录
		NeedPermission: true,                                  //是否需要鉴权
		PermissionName: "Trip.update",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "修改旅行",
			Description: "",
			RequestDto:  sdto.TripUpdate{},
		},
	})

	// 删除
	AppendRouter(ItemInfo{
		Path:           apis.ApiTripDelete,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripDelete), //对应控制器
		HttpType:       HttpPost,                              //http请求类型
		NeedLogin:      false,                                 //是否需要登录
		NeedPermission: false,                                 //是否需要鉴权
		PermissionName: "Trip.delete",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "删除旅行",
			Description: "",
			RequestDto:  sdto.TripDelete{},
		},
	})

	//search 搜索
	AppendRouter(ItemInfo{
		Path:           apis.ApiTripSearch,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripSearch), //对应控制器
		HttpType:       HttpPost,                              //http请求类型
		NeedLogin:      false,                                 //是否需要登录
		NeedPermission: false,                                 //是否需要鉴权
		PermissionName: "Trip.search",                         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "获取旅行列表",
			Description: "",
			RequestDto:  dto.ReqSearch{},
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiTripImport,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripImport), //对应控制器
		HttpType:       HttpPost,                              //http请求类型
		NeedLogin:      true,                                  //是否需要登录
		NeedPermission: true,                                  //是否需要鉴权
		PermissionName: "Trip." + enums.BtnAuthImport,         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "导入旅行",
			Description: "",
			RequestDto:  dto.ReqSearch{},
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiTripImportTemplateFile,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripImportTemplateFile), //对应控制器
		HttpType:       HttpPost,                                          //http请求类型
		NeedLogin:      true,                                              //是否需要登录
		NeedPermission: false,                                             //是否需要鉴权
		PermissionName: "Trip." + enums.BtnAuthImport,                     //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "获取导入旅行模板文件",
			Description: "",
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiTripExport,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripExport), //对应控制器
		HttpType:       HttpPost,                              //http请求类型
		NeedLogin:      true,                                  //是否需要登录
		NeedPermission: true,                                  //是否需要鉴权
		PermissionName: "Trip." + enums.BtnAuthExport,         //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "导出旅行",
			Description: "",
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiTripAiPlanningStream,                    //api路径
		Handlers:       ginp.ConvHandler(custctrl.TripAiPlanningStream), //对应控制器
		HttpType:       HttpGet,                                         //http请求类型
		NeedLogin:      false,                                           //是否需要登录
		NeedPermission: false,                                           //是否需要鉴权
		PermissionName: "",                                              //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "TripAiPlanningStream",
			RequestDto:  requestdto.TripAiPlanningStream{},
			Description: "",
		},
	})
	//{{append}}

}
